/*
============================================================================
 Name        : BlockBargain.h
 Author      : \x{738b}\x{658c}
 Version     :
 Copyright   : \x{76ca}\x{76df}\x{8f6f}\x{4ef6}
 Description : CBlockBargain declaration
============================================================================
*/

#ifndef BlockBargain_H
#define BlockBargain_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"
// CLASS DECLARATION

/**
*  CBlockBargain
* 
*/

class TBar
{
public:
	TInt m_nTime;
	TInt m_nPrice;
	TInt m_nVolume;
	TInt  m_nTradeNum;
	TInt64 m_lCurVol;
	TInt64 m_lOI;
	TInt8 m_bBS;
};


class CBlockBargain  : public CBlockGoods
{
public:
	~CBlockBargain();

	static CBlockBargain* NewL(CBaseBlock* bsBack);

	static CBlockBargain* NewLC(CBaseBlock* bsBack);

	CBlockBargain(CBaseBlock* bsBack);


public:
	//from CBlock
	void OnDraw(CFbsBitGc& g) const;

	void InitData();

	void OnInput(const TDesC8& strInput);

	TInt32 GetMenuItem();

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	TInt GetDataLength();

	TInt16 GetDataType();

	void OnKeyDown(TInt keyCode);

	void SizeChanged();

private:
	void ConstructL();

protected:
	void AddTabs();

public: // from MTabbarObserver
	void HandleTabbarCommand(TInt aCommand);

private:
	RArray<TBar>	m_vBar;
	TInt32 m_nXPrice;

	TBuf<32> m_bufDownloading;
	TBuf<32> m_bufNoInfo;

	TInt m_nXCurVol;
	TInt8 m_bWantClose;
	TInt m_nTotal;

	TInt m_nXO;
	TInt m_nXI;
	TBool m_bIsGZQH;
};

#endif // BlockBargain_H
